home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Basketball / BBMidlet_SL45.jar / bbmidlet / mode / DemoMode$ShootTimerTask.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-02-06  |  952 b   |  38 lines

  1. package bbmidlet.mode;
  2.  
  3. import java.util.TimerTask;
  4.  
  5. public class DemoMode$ShootTimerTask extends TimerTask {
  6.    // $FF: renamed from: vx int
  7.    int field_0;
  8.    // $FF: renamed from: vy int
  9.    int field_1;
  10.    int vx0;
  11.    int vy0;
  12.    // $FF: renamed from: f1 bbmidlet.mode.DemoMode
  13.    private final DemoMode field_2;
  14.  
  15.    public DemoMode$ShootTimerTask(DemoMode var1) {
  16.       this.field_2 = var1;
  17.       this.vx0 = (int)((long)DemoMode.access$100(var1).nextInt() * 10L / 2147483647L);
  18.       this.vy0 = 4 + Math.abs((int)((long)DemoMode.access$100(var1).nextInt() * 10L / 2147483647L));
  19.       DemoMode.access$000(var1).handleKeyPressed(8);
  20.    }
  21.  
  22.    public void run() {
  23.       if (this.field_1 < this.vy0) {
  24.          ++this.field_1;
  25.          DemoMode.access$000(this.field_2).handleKeyPressed(1);
  26.       } else if (this.field_0 < this.vx0) {
  27.          ++this.field_0;
  28.          DemoMode.access$000(this.field_2).handleKeyPressed(5);
  29.       } else if (this.field_0 > this.vx0) {
  30.          --this.field_0;
  31.          DemoMode.access$000(this.field_2).handleKeyPressed(2);
  32.       } else {
  33.          DemoMode.access$000(this.field_2).handleKeyPressed(8);
  34.          this.field_2.waitForShot();
  35.       }
  36.    }
  37. }
  38.